package com.weiiew.common.config;

import com.weiiew.common.GatawayAccess.GatewayAccessAspect;
import com.weiiew.common.OnlyFeign.OnlyFeignAspect;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.EnableAspectJAutoProxy;

/**
 * @Description
 * @Author 魏锴
 * @Date 2025/4/2
 */
@Configuration
@ConditionalOnWebApplication
@EnableAspectJAutoProxy
public class AutoConfiguration {
    @Bean
    @ConditionalOnMissingBean
    public GatewayAccessAspect gatewayAccessAspect() {
        return new GatewayAccessAspect();
    }

    @Bean
    @ConditionalOnMissingBean
    public OnlyFeignAspect onlyFeignAspect(){
        return new OnlyFeignAspect();
    }
}